package com.wandian.game
{
	import flash.display.Sprite;
	import com.wandian.game.Actions;
	import com.wandian.mvc.Action;
	import com.wandian.mvc.Mediator;

	public class GameMediator extends Mediator
	{
		private var gameContainer:GameContainer

		public function GameMediator(name:String, ui:GameContainer)
		{
			super(name, ui);
			this.gameContainer=ui
			this.addInterest(Actions.EnterGame);
		}
		
		/**
		 * 重写了中介者的处理事件方法
		 * @param action
		 */
		override protected function handleAction(action:Action):void
		{
			switch (action.type)
			{
				case Actions.EnterGame:
					gameContainer.switchToGameFrame();
					this.dispatchAction(Actions.StartGame, action.getData())
					break;
			}
		}
	}
}
